package com.hexu.event.util;

import java.util.Base64;

public class Base64Util {

    //Base64 加密
    public static String encrypt(String str){
        byte[] bytes = str.getBytes();
        String encoded = Base64.getEncoder().encodeToString(bytes);

        return encoded;
    }
    //Base64 解密
    public static String decode(String encoded){
        byte[] decoded = Base64.getDecoder().decode(encoded);

        String decodeStr = new String(decoded);
        return decodeStr;
    }
}
